So I've been playing around with my game trying to test the performance of it, and these coins kind
of pushed it over the edge.
So, yeah, a glitch there.
That's no good.
We're not even close to done, so we're going to have to do some optimization.
I'm going to look at my performance real quick and yours might be closed up.
It might look like this, right?
So you can open your performance, open your memory.
If it's closed, you have core memory, place, memory.
And you might want to take snapshots of this stuff while you're optimizing.
I'm not going to go through all of it, but you'll get familiar with the ones where you're kind of guilty
at.
Now, we haven't done any network stuff, so I'm not worried about that.
Let's look at our workspace.
Our frames per second looks good.
Heart rate looks good.
Kind of died there for a second.
Open the world primitives.
Way too many primitives.
We have too small buildings.
Right.
So we're going to have to get rid of some of these coins.
Let's do some optimization now.
When I close my performance window, I turn off my game.
I'm going to go to my wave loop, which is under server script server.
Service.
There we go.
A wave loop.
And we got 1000 coins, a lot of coins, each with their own rotate script going around.
Let's make that, like 250.
Also on the coin.
Let's take a look at our coin.
It's in server storage.
Coin.
I'm going to go to properties.
I'm going to search for cast, cast, shadow.
Those coins don't need to cast a shadow.
So that's one more thing we don't have to worry about for our resources.
All right.
The health pickups aren't that bad.
Land mines aren't that bad.
I think I'm going to reduce those land mines.
I maybe we'll do well.
Let's keep 15, but distance from sign.
Maybe I'll stretch that out a little bit.
We're getting kind of cluttered a number of health's.
We can reduce that.
We have a whole bunch of health.
We're just kind of showing recasting on that.
And let's look at our wave loop.
The that that eruption goes off way too many times.
So you could make this a random number.
Instead of using wave loop.
And I think I'm going to.
Increase our distance between firing the eruption maybe every 15th wave loop.
All right, what else should I do?
Let's go to our session.
Utils.
One thing I noticed in session utils.
Right here under our place coin.
This is a little bit energy intensive with our cast down array, but we do need it because we have that
hill and.
We are killing off most of the coins at 5 minutes.
If you have a lot of players getting them, that's going to be different.
So we're going to be able to put coins in over time.
But on startup, we're going to put like 250 coins in at once.
Let's go ahead and make this a random time to live.
So we have a random number generator named R.
We'll do a next end and then say 300 to 500, maybe 1000.
Now we'll do 6/602.
So that's 5 minutes to 10 minutes.
Sorry about bumbling like that.
Let's go ahead and copy that, Control.
See?
And then maybe down here.
Control V will do that with the health's.
And then place mines is fine.
That already has a random number.
Let's just go ahead and increase that there.
Let's make that 300.
To 605 minutes to 10 minutes.
And I think I'm going to do one more thing under these coins since we have like 251 responding.
Let's just put a tiny weight in there.
That's what, 0.0 3 seconds.
But that's going to that's going to make it so we don't exhaust our resources for that period of time
where we do our 200 coins.
All right.
Let's try this out and see what we got.
And it's too early to tell.
We have to wait for an eruption to go off and some coins to pop up.
It's looking good.
It's feeling good.
I'm not getting a lot of glitches.
Our performance, I didn't take a snapshot, but we can we can take a quick look.
It doesn't look that much different here.
Let's take a look at our workspace.
And this heartbeat is not dying out.
Here goes.
Interruption.
Let's take a look at our world.
So 433 parameters, that's a lot better.
There's a coin I can run real fast.
Yeah, this is working pretty good.
I'm not.
I'm not experiencing any glitching.
Cool.
So you'll have to keep keep that in mind, keep playing your game as you're adding stuff to it and then
play it on Roadblocks.
Also, even though it's private, you'll still be able to get it.
So you want to keep up with that because you don't want to have an entire game and then realize rats.
I have too much stuff in it.